/*!
	@file		 	(framework)Common.js
	@abstract	 	Classes for all
	@discussion	 	Includes the class for the users : OLFUtils
	@author 		Created by Robin Ricard on 17/08/09.
	@licence 		This Document is under LGPL License, please read this document : http://www.gnu.org/licenses/lgpl-3.0-standalone.html
*/

/*!
	@class			GlueUtils
	@abstract		Provides methods for help the framework and the user 
*/

/*!
	@constructor
	@discussion	 	He is empty
*/
function GlueUtils() {
	// (empty) //
}


/*!
	@function		getElementsByClass
	@abstract	 	Gives DOM nodes with a class name
	@discussion		Returns an arry of matching results
	@parameter		searchClass: the class name
	@parameter		node: where searching (opt.)
	@parameter		tag: specify who's the tag (opt.)
*/
/*
	Developed by Dustin Diaz, http://www.dustindiaz.com
	Code/licensing: http://www.dustindiaz.com/getelementsbyclass/
*/
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


/*!
	@class			String
	@abstract		Standard Javascript String class
*/
/*!
	@method 		toDom
	@abstract 		Convert a string to a DOM node
	@discussion 	A string to DOM converter for the String Object
*/
String.prototype.toDOM = function() {
	var html = document.createElement('div');
	html.innerHTML = this;

	return html;
}